(()=>{
    console.log("asadklmkn")
    //雷电预警系统左边导航
    $("#leftnav").on("click","li",function(){
        $(this).addClass("ldyjactive").siblings().removeClass("ldyjactive");
       // var a=$(this)[0].innerText.trim()
        var a=$(this)[0].innerText.trim()
        //console.log(a);
        if(a=="日期查询"){
            $(".rqcx").css("display","block").siblings().css("display","none")
            //sconsole.log(1)

        }else if(a=="预警点查询"){
            console.log((123))
            $(".yjdcx").css("display","block").siblings().css("display","none");

        }
    });
    //选择日期
    $("#yearadd").on("click",function(){
        var a=$("#yearselect")[0].value
        var b=parseInt (a)+1;
        if(b<2020){$("#yearselect").val(b)}
        
    });
    $("#yearminus").on("click",function(){
        var a=$("#yearselect")[0].value
        var b=parseInt(a)-1;
        if(b>1995){
            $("#yearselect").val(b)
        }
       
    });
    //选择日期1
    $("#yearadd1").on("click",function(){
        
        var a=$("#yearselect1")[0].value
        var b=parseInt (a)+1;
        
        if(b<2020){$("#yearselect1").val(b)}
        
    })
    $("#yearminus1").on("click",function(){
        var a=$("#yearselect1")[0].value
        var b=parseInt(a)-1;
        console.log(1)
        if(b>1995){
            $("#yearselect1").val(b)
        }
       
    })
    //地区树
    var zTreeObj;

var setting = {};

var zNodes = {{location}};

$(document).ready(function(){

   zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, zNodes);

}); 
    //选择地区
    $("#dqyj").on("click",function(){
        $(".adresstree").css("display","block")
    })
    $("#treeDemo").on("click","span",function(){
        console.log($(this))
        var a=$(this)[0].classList[0]
        console.log(a)
        if(a=="node_name"){
            var b=$(this)[0].innerHTML
            console.log(b)
            $("#dqxz").val(b)
            $(".adresstree").css("display","none")
        }
    })
})()